[#if enquiry?? ]
<table class="table table-hover table-bordered table-striped ">
	<tr>
		<th colspan="2" >${enquiry.title!}</th>
	</tr>
	
	<tr>
		<td colspan="2" class="tc" >
		${allStates[enquiry.prostate?string]} 》》  ${allStates[prostate?string]}
		</td>
	</tr>
	
	[#if phone?? ]
	<tr>
		<th>发送短信提示:${phone}</th>
		<td class="w80"><input class="w50"  id="smscheck" type="checkbox" value="1"   checked="checked"  ></td>
	</tr>
	[/#if]
	
	[#if email?? ]
	<tr>
		<th>发送邮件提示:${email}</th>
		<td class="w80"><input class="w50"  id="emailcheck" type="checkbox" value="1"   checked="checked"  ></td>
	</tr>
	[/#if]
	
	[#if prostate ==2 ]
	<tr>
		<th>退回原因:</th>
		<td class="w80" ><input  id="backreason"  type="text" name="backreason"   ></td>	
	</tr>
	[/#if]
	
	
	[#if prostate ==1 && enquiry.pubtype ==1 && enquiry.hadsendsms==0 ]
	<tr>
		<th>发短信至相关供应商:</th>
		<td class="w80" ><input class="w50" id="typesmscheck"  type="checkbox" value="1" checked="checked"    ></td>	
	</tr>
	[/#if]
	
	
	<tr>
		<td colspan="2"  class="tc" >
			<button type="button" class="btn btn-success" onclick="gotochange(${enquiryid},${prostate})"  >确定 </button>
		</td>
	</tr>
</table>

<script>
function gotochange(enquiryid,prostate){
	var smscheck =0;
	
	if($("#smscheck").is(":checked")){
		smscheck = 1;
	};
	
	var emailcheck = 0;	
	if($("#emailcheck").is(":checked")){
		emailcheck = 1;
	};
	
	var typesmscheck = 0;	
	if($("#typesmscheck").is(":checked")){
		typesmscheck = 1;
	};
	
	
	var backreason = $("#backreason").val();
	art.dialog.post({
		url:"/purchase/o_prostate_changed.do",
		data:{enquiryid:enquiryid,prostate:prostate,smscheck:smscheck,emailcheck:emailcheck,backreason:backreason,typesmscheck:typesmscheck},
		success:function(data){
			if(data.success){
				art.dialog.alert(data.msg,function(){
					//刷新
					changestatrecallback();
				});
			}else{
				art.dialog.tips(data.msg);
			}
		}
	});
}

</script>

[/#if]
